<template>
  <!-- 顶部导航栏 -->
  <PageHeader />

  <!-- 首页主体内容 -->
  <main>
    <!-- Hero 区域 -->
    <section class="hero">
      <h1>私密高效的技术支持平台</h1>
      <p class="tagline">指定专家接单 · 内容安全审核 · 闭环协作管理</p>

      <div class="features">
      <span>
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
        </svg>
        点对点指定专家
      </span>
        <span>
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4" />
        </svg>
        文件自动脱敏扫描
      </span>
        <span>
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.165-2.052-.48-3.016z" />
        </svg>
        管理员审核机制
      </span>
      </div>

      <div class="cta-buttons">
        <a href="#" @click.prevent="toPath('/publish')" class="btn btn-primary">立即发布问题</a>
        <a href="#" @click.prevent="toPath('/my')" class="btn btn-outline">查看我的问题</a>
      </div>
    </section>

    <!-- 功能亮点卡片 -->
    <section class="cards">
      <div class="card">
        <div class="card-icon">💡</div>
        <h3>问题精准派发</h3>
        <p>每次发布可指定 1~3 名技术专家，确保问题直达责任人，避免无效沟通。</p>
      </div>
      <div class="card">
        <div class="card-icon">🔐</div>
        <h3>数据安全防护</h3>
        <p>所有上传文件自动进行病毒扫描与敏感词检测（如 password、key），保障信息安全。</p>
      </div>
      <div class="card">
        <div class="card-icon">🔄</div>
        <h3>闭环协作流程</h3>
        <p>专家标记“已完成”后需提问者确认，形成完整解决闭环，防止草率关闭。</p>
      </div>
    </section>

    <!-- 开发团队介绍 -->
    <section class="team-section">
      <h2>由热爱技术的开发者打造</h2>
      <p>我们是一支专注于企业级工具研发的小团队，致力于构建安全、可控、高效的内部协作系统。</p>
      <a href="https://gitee.com/anxwefndu/code-help" target="_blank" class="github-link">
        <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
          <path
              d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
        </svg>
        查看 GitHub 项目
      </a>
    </section>
  </main>

  <!-- 底部 Footer -->
  <footer class="footer">
    <div class="footer-container">
      <div class="footer-links">
        <a href="https://gitee.com/anxwefndu/code-help" target="_blank">GitHub 仓库</a>
        <a href="#" @click.prevent>帮助中心</a>
        <a href="#" @click.prevent>隐私政策</a>
        <a href="#" @click.prevent>服务条款</a>
      </div>
      <div class="footer-copyright">
        © 2025 CodeHelp 技术支持平台<br>
        粤ICP备12345678号 | 粤公网安备 12345678901234号
      </div>
    </div>
  </footer>
</template>

<script setup>
import router from '@/router'
import PageHeader from "@/components/PageHeader.vue";

function toPath(path) {
  router.push({ path })
}
</script>

<style scoped>
/* =============== 主体内容 =============== */
.hero {
  max-width: 900px;
  margin: 70px auto 40px;
  text-align: center;
  padding: 0 20px;
}

.hero h1 {
  font-size: 38px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.hero p.tagline {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 36px;
}

.features {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 20px 0 50px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--text-light);
}

.features span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.features svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* 功能亮点卡片 */
.cards {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 0 20px;
  margin: 60px 0;
  flex-wrap: wrap;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  width: 300px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  text-align: left;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

.card-icon {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--primary);
}

.card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* 团队介绍 */
.team-section {
  text-align: center;
  margin: 80px 0;
  padding: 0 20px;
}

.team-section h2 {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 16px;
}

.team-section p {
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 24px;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  transition: all 0.2s;
}

.github-link:hover {
  background: #eff6ff;
}

.github-link svg {
  width: 18px;
  height: 18px;
}

/* CTA 按钮 */
.cta-buttons {
  margin-top: 40px;
}

.btn {
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  margin: 0 14px;
  display: inline-block;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: #ebf5ff;
}

/* =============== 底部 Footer =============== */
.footer {
  margin-top: 100px;
  padding: 40px 30px;
  background: var(--white);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copyright {
  margin-top: 10px;
  line-height: 1.6;
}

/* =============== 响应式 =============== */
@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
    height: 60px;
  }

  .nav-right {
    gap: 12px;
  }

  .nav-menu {
    gap: 16px;
  }

  .nav-menu a {
    font-size: 14px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p.tagline {
    font-size: 16px;
  }

  .features {
    gap: 20px;
    font-size: 14px;
  }

  .cards {
    gap: 16px;
  }

  .card {
    width: 100%;
    max-width: 300px;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .btn {
    display: block;
    margin: 10px auto;
    width: 80%;
    max-width: 220px;
  }
}

@media (max-width: 480px) {
  .hero {
    margin: 60px 0 30px;
  }

  .team-section h2 {
    font-size: 20px;
  }
}
</style>
